export default {
  data() {
    return {
      deviceType: null,
    };
  },
  created() {
    this.checkDeviceType();
    window.addEventListener('resize', this.checkDeviceType);
  },
  beforeDestroy() {
    window.removeEventListener('resize', this.checkDeviceType);
  },
  methods: {
    checkDeviceType() {
      const width = window.innerWidth;
      if (width <= 768) {
        this.deviceType = 'mobile';
      } else if (width > 768 && width <= 1024) {
        this.deviceType = 'ipad';
      } else {
        this.deviceType = 'web';
      }
      // console.log(this.deviceType, 'this.deviceType');
    },
  },
};